package com.changgou.listener;

import com.changgou.config.RabbiteMQConfig;
import com.changgou.service.PageService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class PageListener {
    @Autowired
    private PageService pageService;
    @RabbitListener(queues = RabbiteMQConfig.GOODS_PAGE_QUEUE)
    public void receiveMessage(String spuId){
        System.out.println("生成商品详情页面,商品id为:"+spuId);
        //生成静态化页面
        pageService.generateItemPage(spuId);
    }
}
